package mapper;

import java.util.Map;
import java.util.TreeMap;

import osc.OSCMessage;

public class OSC2MIDIBindings {

	Map<String, OSC2MIDITranslation> bindings = new TreeMap<String, OSC2MIDITranslation>();

	public void addTranslation(String eventOSCSource, OSC2MIDITranslation translation) {
		bindings.put(eventOSCSource, translation);
	}

	public void translate(OSCMessage message) {
		if (message != null) {
			OSC2MIDITranslation translation = bindings.get(message.getTarget());
			if (translation != null) {
				translation.translate(message);
			}
		}
	}

}
